package com.haoze.nurseapp.dao;

import com.haoze.common.mapper.MyMapper;
import com.haoze.common.model.OrdersFileIndexDataEntity;
import com.haoze.common.model.TaskExecuteBatchEntity;
import com.haoze.nurseapp.dto.task.OrdersFileIndexDataDTO;
import com.haoze.nurseapp.model.MessageRemindingEntity;
import com.haoze.nurseapp.vo.batch.TaskTransferVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TaskExecuteBatchMapper extends MyMapper<TaskExecuteBatchEntity> {
    Map<String, String> selectBatchInfoByQrcode(@Param("qrCode") String qrCode);

    TaskExecuteBatchEntity selectBatchCountByQrcode(@Param("qrCode") String qrCode);

    List<TaskTransferVo> selectTaskTransfer(String actionName);

    String selectNextNodeEmrFileId(@Param("qrCode") String qrCode);

    List<OrdersFileIndexDataEntity> selectChildElementByParentElementId(@Param("saveElementId") String saveElementId, @Param("qrCode") String qrCode);

    void deleteChildEmrFileData(@Param("elementId") String elementId, @Param("emrFileId") String emrFileId);

    Map<String, String> selectEmrFileIdByQrCode(@Param("qrCode") String qrCode, @Param("type") String type);

    List<TaskExecuteBatchEntity> selectBatchEntityByQrcode(@Param("qrCode") String qrCode);

    TaskExecuteBatchEntity getLastBatchEntity(@Param("taskExecuteDetailId") String taskExecuteDetailId, @Param("taskNodeId") String taskNodeId);

    int getMaxSerialNo(@Param("inpatorderdataId") String inpatorderdataId, @Param("batchNo") Long batchNo);

    TaskExecuteBatchEntity queryTaskBatch(@Param("batchNo") long batchNo, @Param("inpatorderdataId") String inpatorderdata_id);

    long selectMaxBatchByInpatorderdataId(@Param("inpatorderdataId") String inpatorderdataId);

    void updateBatchNo(@Param("taskBatchId") String taskBatchId, @Param("inpatorderdataId") String inpatorderdataId);

    Map<String, String> queryOrdersByInpat(@Param("inpatNum") String inpatNum, @Param("orderNo") String orderNo);

    TaskExecuteBatchEntity selectInfoByInpatorderdataId(@Param("inpatorderdataId") String inpatorderdataId);

    Integer queryInfoByTaskNodeId(@Param("qrCode") String qrCode, @Param("taskNodeId") String taskNodeId);

    Map<String, Object> selectOrderStatusByInpatorderdataId(String inpatOrderDataId);

    int getMaxSerialNo(@Param("inpatorderdataId") String inpatorderdataId, @Param("batchNo") int batchNo);

    TaskExecuteBatchEntity getLastBatchEntity(@Param("inpatorderdataId") String inpatorderdataId, @Param("batchNo") int batchNo);

    List<TaskExecuteBatchEntity> selectByParams(Map<String, Object> params);

    Integer getMaxBatchNo(@Param("taskExecuteDetailId") String taskExecuteDetailId, @Param("taskNodeId") String taskNodeId);

    TaskExecuteBatchEntity getLastBatchEntityByQrcode(@Param("orderQrCode") String orderQrCode);

    TaskExecuteBatchEntity queryTaskBatchByInpatorderdataIdAndBatchNo(@Param("inpatorderdataId") String inpatorderdataId, @Param("batchNo") String batchNo);

    void insertRemindInfo(MessageRemindingEntity remindingEntity);

    String getPreEmrFileId(@Param("qrCode")String qrCode);

    List<Map<String,String>> queryQrCodeByInpatorderdataIdAndBatchNo(@Param("inpatorderdataId") String inpatorderdataId, @Param("batchNo") String batchNo);

}
